package org.iabako.client.ui.page.business.expense;

import org.iabako.client.config.page.PageConfigEnum;
import org.iabako.client.navigation.NavigationController;
import org.iabako.client.tools.IabakoAsyncCallback;
import org.iabako.client.ui.form.business.expense.ExpenseForm;
import org.iabako.shared.entity.business.AbstractEntity;
import org.iabako.shared.entity.business.Expense;

/**
 * Created by jose on 06/11/14.
 */
public class ExpenseModify extends ExpenseForm {

    public ExpenseModify() {
        super(PageConfigEnum.ExpenseModify, "");

        String[] params = NavigationController.getInstance().getParams();

        expenseServiceAsync.getById(Long.parseLong(params[0]), new IabakoAsyncCallback<AbstractEntity>() {
            public void onSuccess(AbstractEntity result) {
                setExpense((Expense) result);
                super.onSuccess(result);
            }
        });

    }

}
